app.controller('BookController',['$scope', '$routeParams', function($scope, $routeParams){
	$scope.userId = $routeParams.userId;

	$scope.title = 'Myt title';
	$scope.promo = 'My prompt';
	$scope.products = [ 
	{ 
	  name: 'The Book of Trees', 
	  price: 19, 
	  pubdate: new Date('2014', '03', '08'), 
	  cover: 'img/the-book-of-trees.jpg',
	  likes: 0,
	  dislikes: 0
	}, 
	{ 
	  name: 'Program or be Programmed', 
	  price: 8, 
	  pubdate: new Date('2013', '08', '01'), 
	  cover: 'img/program-or-be-programmed.jpg',
	  likes: 0,
	  dislikes: 0
	}
	 ,{ 
	  name: 'sudongpo', 
	  price: 18, 
	  pubdate: new Date('1996', '08', '01'), 
	  cover: 'img/the-book-of-trees.jpg',
	   likes: 0,
	  dislikes: 0
	}
	 ,{ 
	  name: 'yuwen', 
	  price: 8, 
	  pubdate: new Date('2015', '08', '01'), 
	  cover: 'img/the-book-of-trees.jpg',
	  likes: 0,
	  dislikes: 0
	} 
	];
	$scope.plusOne = function(index) { 
	$scope.products[index].likes += 1; 
	};
	$scope.minusOne = function(index) { 
	$scope.products[index].dislikes += 1; 
	};
	$scope.productsIndex = 0;
	$scope.productGroups = [
		{
		groupName: 'fun',
		groupDetails:[ 
			{ 
			  name: 'The Book of Trees', 
			  price: 19, 
			  pubdate: new Date('2014', '03', '08'), 
			  cover: 'img/the-book-of-trees.jpg',
			  likes: 0,
			  dislikes: 0
			}, 
			{ 
			  name: 'Program or be Programmed', 
			  price: 8, 
			  pubdate: new Date('2013', '08', '01'), 
			  cover: 'img/program-or-be-programmed.jpg',
			  likes: 0,
			  dislikes: 0
			}
			 ,{ 
			  name: 'sudongpo', 
			  price: 18, 
			  pubdate: new Date('1996', '08', '01'), 
			  cover: 'img/the-book-of-trees.jpg',
			   likes: 0,
			  dislikes: 0
			}
			 ,{ 
			  name: 'yuwen', 
			  price: 8, 
			  pubdate: new Date('2015', '08', '01'), 
			  cover: 'img/the-book-of-trees.jpg',
			  likes: 0,
			  dislikes: 0
			} 
		]
		}
		,{
		groupName: 'novel',
		groupDetails:[
			{ 
			  name: 'The Book of Trees', 
			  price: 19, 
			  pubdate: new Date('2014', '03', '08'), 
			  cover: 'img/the-book-of-trees.jpg',
			  likes: 0,
			  dislikes: 0
			}, 
			{ 
			  name: 'Program or be Programmed', 
			  price: 8, 
			  pubdate: new Date('2013', '08', '01'), 
			  cover: 'img/program-or-be-programmed.jpg',
			  likes: 0,
			  dislikes: 0
			}
			 ,{ 
			  name: 'sudongpo', 
			  price: 18, 
			  pubdate: new Date('1996', '08', '01'), 
			  cover: 'img/the-book-of-trees.jpg',
			   likes: 0,
			  dislikes: 0
			}
			 ,{ 
			  name: 'yuwen', 
			  price: 8, 
			  pubdate: new Date('2015', '08', '01'), 
			  cover: 'img/the-book-of-trees.jpg',
			  likes: 0,
			  dislikes: 0
			}
		]
		}
	];
}]);